<?php

namespace App\Http\Controllers\Admin;

use Ganguo\ClientAggregationUpload\Factory as ClientAggregationUpload;

class SupplierController extends Controller
{
    /**
     * @return mixed
     */
    public function getUpload()
    {
        $drive = request('drive', 'qiniu');

        $data = (new ClientAggregationUpload($drive))->getParameter();

        return \Response::success($data);
    }

    /**
     * @param \Illuminate\Http\Request $request
     *
     * @return mixed
     */
    public function postUpload(\Illuminate\Http\Request $request)
    {
        $data = (new ClientAggregationUpload())->local($request);

        return \Response::success($data);
    }
}
